package com.woniuxy.controller;

import com.woniuxy.entity.ComplexityTable;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.ComplexityTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * description: 难度程度Controller <br>
 * date: 2022/6/1 1:19 上午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */
@RestController
@RequestMapping("/complexity")
public class ComplexityTableController {
    @Autowired
    private ComplexityTableService complexityTableService;

    @RequestMapping("/list")//查询所有难易程度
    public ResponseEntity findAllComplexity() {
        List<ComplexityTable> ComplexityList = complexityTableService.findAllComplexity();
        if (ComplexityList != null) {
            return new ResponseEntity(200, "查询成功", ComplexityList);
        } else {
            return new ResponseEntity(500, "查询失败", null);
        }
    }
}
